package jsu.xxy.coffee3.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

import lombok.Data;

/**
 * 进货单表
 * @TableName purch_list
 */
@TableName(value ="purch_list")
@Data
public class PurchList implements Serializable {
    /**
     * 供应商id
     */
    @TableId
    private Integer supid;

    /**
     * 原材料id
     */
    private Integer mid;

    /**
     * 进货数量
     */
    private Integer goodsnum;

    /**
     * 进货时间
     */
    private LocalDateTime time;

    /**
     * 单价
     */
    private Double price;

    /**
     * 总价
     */
    private Double total;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PurchList other = (PurchList) that;
        return (this.getSupid() == null ? other.getSupid() == null : this.getSupid().equals(other.getSupid()))
            && (this.getMid() == null ? other.getMid() == null : this.getMid().equals(other.getMid()))
            && (this.getGoodsnum() == null ? other.getGoodsnum() == null : this.getGoodsnum().equals(other.getGoodsnum()))
            && (this.getTime() == null ? other.getTime() == null : this.getTime().equals(other.getTime()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getTotal() == null ? other.getTotal() == null : this.getTotal().equals(other.getTotal()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSupid() == null) ? 0 : getSupid().hashCode());
        result = prime * result + ((getMid() == null) ? 0 : getMid().hashCode());
        result = prime * result + ((getGoodsnum() == null) ? 0 : getGoodsnum().hashCode());
        result = prime * result + ((getTime() == null) ? 0 : getTime().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getTotal() == null) ? 0 : getTotal().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", supid=").append(supid);
        sb.append(", mid=").append(mid);
        sb.append(", goodsnum=").append(goodsnum);
        sb.append(", time=").append(time);
        sb.append(", price=").append(price);
        sb.append(", total=").append(total);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}